import numpy as np
import matplotlib.pyplot as plt
from pylab import *
import seaborn as sns
# plt.rcParams['axes.facecolor']='#5cb3cc'
plt.rcParams['font.sans-serif'] = 'KaiTi'#宋体设置
plt.rcParams['axes.unicode_minus'] = False   # 字符显示
# 修改背景颜色


vals1 = [0.156109436,0.270456993,0.569927715,0.003505856
]
vals2 = [12.5,25,57.5,5]
vals3 = [1]
vals4 = [1]
fig, ax = plt.subplots()
labels = '蛋白质', '脂肪', '碳水化合物', '膳食纤维'
wedgeprops = {'linewidth': 1, 'edgecolor': '#96c24e', 'alpha': 1}# 粉 f0a1a8   蓝 5cb3cc
ax.pie(vals1, radius=1.33,autopct='%1.1f%%',pctdistance=0.85,colors = ['#fed71a','#ff9900','#f0a1a8','#617172'],wedgeprops=wedgeprops)
ax.pie(vals4, radius=0.93,colors=['w'])
ax.pie(vals2, radius=0.9,autopct='%1.1f%%',pctdistance=0.78,colors = ['#fed71a','#ff9900','#f0a1a8','#617172'], wedgeprops=wedgeprops)
ax.pie(vals3, radius=0.5,colors=['w'])
ax.set_title('女生能量转化比例', pad=20)  #plt.legend()
plt.legend(labels,bbox_to_anchor=(1, 1), loc='best', borderaxespad=0.)
# fig.set_facecolor('#ad9e5f')

plt.show()

# "异亮氨酸","亮氨酸","赖氨酸","含硫氨基酸","芳香族氨基酸","苏氨酸","色氨酸","缬氨酸"
# 男生中饭
# 76.40739889,54.57127128,54.35125929,69.5849013,99.00311681,72.11493025,157.5459387,64.22760868

# 男生晚饭
# 93.57036527,119.5504194,91.71509444,55.82124934,123.7081669,90.06448213,41.10332755,93.4605888,


# 女生早饭
# 87.20455798,98.9096526,86.86472101,100.8448689,116.0241208,83.92782211,106.0735829,83.25205107

# 女生中饭
# 69.7021483,69.08574811,67.20273516,98.7307525,98.69797501,77.43216951,137.3349449,73.82909683

# 女生晚饭
# 96.85627341,88.47960389,95.79036284,87.59908772,123.3143799,88.88845974,149.6402487,93.52033656

# 男2.3早
# 118.9751843,116.0725424,89.86086615,89.33007477,160.2262609,160.6650236,158.430211,122.0813165

# 中
# 112.1204904,112.4481877,111.0698263,86.14931595,145.8475208,111.2281045,154.8495257,128.1289077

# 晚
# 67.08983069,76.22157566,54.52095342,70.35148444,80.28222525,59.92887918,65.1702274,70.17900713

# 女2.3早
# 98.37011712,95.1630106,73.25476122,109.0813275,119.480532,78.76313775,125.0546564,89.06073204

# 中
# 72.32496683,71.8327699,73.95729845,106.3207976,100.1823411,76.56411939,126.7882894,76.17222361

# 晚
# 97.72909857,123.0816265,81.81640634,97.19433408,135.8657294,94.66941318,109.459036,111.5176196


# 第三题男早
# 115.8358688,114.1873916,86.83345272,80.97311639,155.4289769,170.0592644,213.6844432,122.865697

# 中
# 95.65467274,88.81283347,82.80829072,104.0550549,130.7022295,88.81450723,115.3634862,105.4933774

# 晚
# 82.72385853,70.09826502,58.05457244,80.39940503,101.5928133,75.10572015,114.0576748,89.32344119

# 第三题女早
# 129.6466373,114.6200492,81.90800624,84.8427301,164.4719761,184.8845799,128.736984,132.7407277


# 中
# 73.78905715,79.11936526,73.24285223,89.42237477,97.7184692,72.70114644,76.46900717,73.57109021


# 晚
# 64.26797023,61.82047996,60.8942033,88.63961444,87.79262116,79.58107788,92.30552284,70.97765238



